<template>
  <div id="website">
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>文章数量</span>
          </div>
          <main>
            <h2>{{num.articlesNum}}</h2>
            <el-divider></el-divider>
          </main>
        </el-card> 
      </el-col>
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>文章类型数量</span>
          </div>
          <main>
            <h2>{{num.ArticleTypesNum}}</h2>
            <el-divider></el-divider>

          </main>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>留言数量</span>
          </div>
          <main>
            <h2>{{num.GuestNum}}</h2>
            <el-divider></el-divider>

            <div></div>
          </main>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: {}
    }
  },
  created() {
    this.getNum()
  },
  methods: {
    async getNum() {
      let res = await this.api.get('getInfoNum')
      if (res.code == 0) this.num = res.data
    }
  },
}
</script>

<style lang="scss">
  #website {
    text-align: center;
  }
</style>